package phone.qyg.com.qyg.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.app.base.tool.BaseActivity;
import com.app.config.AppHttpKey;
import com.app.config.ApplicationConfig;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

import phone.qyg.com.qyg.R;
import phone.qyg.com.qyg.model.Message;
import phone.qyg.com.qyg.utils.AppHttpRequest;


/**
 * 作者：lblbh on 2017/3/18 13:02
 * 邮箱：lanbuhan@163.com
 * 功能：消息详情
 */
@ContentView(R.layout.msg_detials)
public class MsgDetialsActivity extends BaseActivity {

    @ViewInject(R.id.back)
    TextView back;

    @ViewInject(R.id.msg_time)
    TextView msg_time;

    @ViewInject(R.id.msg_content)
    TextView msg_content;

    Message msg;

    @Override
    public void initSucessView() {
        msg = (Message) getTransModels();

        mapKeys.put(AppHttpKey.MESS_IDS,String.valueOf(msg.id));
        AppHttpRequest.appQuitState(ApplicationConfig.UPDATE_MESSIS_READ,
                mapKeys,
                new AppHttpRequest.OnAppHttpListener() {
                    @Override
                    public void onAppHttpState(boolean isState, String result) {
                    }
                });
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        msg_time.setText(setAttributeText(msg.sendTime));
        msg_content.setText(setAttributeText(msg.content));
    }


    @Event(value = {R.id.back})
    private void viewOnClick(View v){
        switch (v.getId()){
            case R.id.back:
                this.finish();
                break;
        }
    }

    @Override
    public void initViewHandler() {

    }
}
